package com.tony.business.config;

import com.tony.business.util.curator.CuratorUtil;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author x
 */
@Configuration
@ConditionalOnProperty(name = "system.zookeeper.enable", havingValue = "true")
public class ZookeeperConfig {

    @Bean(initMethod = "init")
    @ConfigurationProperties("system.zookeeper")
    public CuratorUtil getCuratorUtil() {
        return new CuratorUtil();
    }
}
